<%@ taglib prefix="c" uri="/WEB-INF/tlds/hdiv-c.tld"%>
<%@ taglib prefix="form" uri="/WEB-INF/tlds/hdiv-spring-form-3_0_4.tld"%>
<%@ taglib prefix="spring" uri="/WEB-INF/tlds/hdiv-spring.tld" %>
<%@ taglib prefix="display" uri="http://displaytag.sf.net" %>
<c:url value="mostrarHWF2006.html" var="generarAbono"/>

<%--<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic"%>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean"%>
<%@ taglib uri="http://displaytag.sf.net" prefix="display"%>
<%@ taglib uri="/WEB-INF/tlds/hdiv-c.tld" prefix="c"%>
--%>
    <script type="text/javascript" src="javascript/HMF2003.js"></script>
    <script type="text/javascript" >
    
    
    function cursor_wait() {
      document.body.style.cursor = 'wait';
    }
    
    $(document).ready(function(){
            $("#fecha").datepicker();
        });
    
    function show_loading(){  
        var loadingAnim = document.getElementById('loading_xgene');  
        loadingAnim.innerHTML = '<img src="imagenes/logoProcesandoRight.gif" width=' + xx_r + 'height=' + yy_r + 'alt="Loading" />';  
        loadingAnim.style.display = 'block';      
        } 
    
    function mostrarHoraProceso(){
        if(document.forms[0].fecha.value ==""){
            alert("Ingrese la Fecha de Generación");
            document.forms[0].fecha.focus();
            return false;
        }
        
        if(!checkDate(document.forms[0].fecha)) return false;        
        
        moveForward('mostrarHoraProceso');         
        return true;
    }    
    
    function mostrarLista(){
        if(document.forms[0].fecha.value ==""){
            alert("Ingrese la Fecha");
            document.forms[0].fecha.focus();
            return false;
        }
        
        if(!checkDate(document.forms[0].fecha)) return false;             
        
        moveForward('mostrarGenerados');         
        return true;
    }
    
    function mostrarArchivo(){
        moveForward('mostrarUltimaCarga');
    }    
    
    function mostrar(){     
        //activar el div procesando con javascript
        show_loading();
        setTimeout('show_loading();', 1000);
        cursor_wait() ;
        //////
        moveForward('mostrar');
    }        
    
    function reporteGenerado(){ 
        winwidth='450';
        winheight='920';
        window.open('about:blank', 'window1', 'location=0,directories=0,status=0,scrollbars=1,resizable=1,width='+winwidth+',height='+winheight);
      
        var accion = 'reporteGenerado';
        var target = 'window1';
        document.forms[0].target = target;        
        document.forms[0].accion.value = accion;
        document.forms[0].submit();  
    }      

   
    </script>

<style type="text/css">  
<!-- 
#loading_xgene {display:none;}  
-->  
</style>

<form:form modelAttribute="form" action="${generarAbono}">
<form:hidden path="control"/>
<form:hidden path="accion"/>
<form:hidden path="cliente"/>
<form:hidden path="sucursal"/>
<form:hidden path="formulario"/>
<form:hidden path="lv_fec_hoy"/>
<form:hidden path="lv_hoy"/>
<form:hidden path="lv_man"/>

<table id="fullheighttable" width="775" cellspacing="0" cellpadding="0" align="center">
  <tr>
    <td align="left" valign="top" class="fondo_contenido padtop16left21">
      <table border="0" cellspacing="0" cellpadding="0" class="verdana11bazul">
      <tr>
        <td height="22" align="left" valign="top" class="verdana11bazul">
		<ul class="navlist2">
		<li>
                              <spring:message code="HMF2006.titulo"/>
                            </li>
		</ul></td>
        </tr>
      <tr>
        <td align="left" valign="top" class="borde_totalblanco"><table border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="105" height="23" align="left" valign="top" class="verdana10bazul">Cliente</td>
            <td height="23" align="left" valign="top" class="verdana10negro">                
                <c:out value="${sessionScope.nombreCliente}"/>
               </td>
          </tr>
 
        </table>
        </td>
      </tr>
      </table>
   
      <table border="0" width="550" cellspacing="2" cellpadding="3">
      <tr>
      <td>
       
      <input name="Submit2" type="button" class="boton" value="Por Generar" onclick="javascript:mostrar();"></td>
      <td><input type="button" class="boton" value="Ver ultima Carga" onclick="javascript:mostrarArchivo();"></td>      
            <td>&nbsp;</td>
            <td></td>
      </tr>
      <tr>
      <td></td>
      <td></td>
            <td>&nbsp;</td>
            <td></td>
      </tr>
      <tr>
      <td>Fecha de Generaci&oacute;n</td>
      <td align="left" valign="bottom" class="padright10"><div class="fondo_txtbox90">         
        <form:input path="fecha" maxlength="10" size="12"/>
        </div>        
        
      </td>
      <td>             
      </td>
      <td><input name="Submit2" type="button" class="boton" value="Ver Hora de Proceso" onclick="javascript:mostrarHoraProceso();"></td>
      </tr>
      <tr>
      <td>Hora de Generaci&oacute;n</td>
      <td align="left" valign="bottom" class="padright10">            
            <form:select cssStyle="height: 20px; width: 100px; font-family: Arial; font-size: 8pt"
                        path="horaGenerado">
            <form:option value="0">Todo el dia</form:option> 
            <form:options items="${listaHora}" 
                          itemValue="codigo"
                          itemLabel="descripcion"/>
           </form:select>           
      </td>
      <td></td>
      <td></td>
      </tr>      
      <tr>
      <td><input name="Submit2" type="button" class="boton" value="Mostrar" onclick="javascript:mostrarLista();"></td>
      <td align="left" valign="bottom" class="padright10"></td>
      <td></td>
      <td></td>
      </tr>      
             <tr>
                <td colspan="2">  </td>
                <td colspan="2" align="center">    
                <div id="loading_xgene"><img id="logo" src="imagenes/logoProcesandoRight.gif" alt="Procesando" /></div>  
                </td>
                <td colspan="2">  </td>
               </tr> 
      </table>
   
      <table border="0" cellpadding="0" cellspacing="0" class="margintop20" >
        <tr >
          <td width="100%">
              <display:table id="lista" name="abonosGenerados" cellpadding="0"
                             cellspacing="0" style="width:100%" pagesize="10"
                             requestURI="${generarAbono}"
                             class="its">
               <body>
                <display:column property="tipo"
                                headerClass="even" class="even "
                                title="Tipo Oper."/>
                <display:column property="cargoIngreso"
                                headerClass="even" class="cellderecha "
                                title="Cargo Ingr."/>
                <display:column property="numero"
                                headerClass="even" class="cellderecha "
                                title="CS"/>
                <display:column property="fecha"
                                headerClass="even" class="cellderecha "
                                title="Fecha"/>                
                <display:column property="tipoMonetaria"
                                headerClass="even" class="cellderecha "
                                title="Unidad"/>
                <display:column property="monto"
                                headerClass="even" class="cellderecha "
                                title="Monto"/>
                <display:column property="fechaGene"
                                headerClass="even" class="cellderecha "
                                title="Fec. Gene."/>
                <display:column property="horaGene"
                                headerClass="even" class="cellderecha "
                                title="Hora Gene."/>
                <display:column property="codUsuario"
                                headerClass="even" class="cellderecha "
                                title="Usuario"/>
               </body>
              </display:table>
          </td>
        </tr>
        <tr><td>&nbsp;</td>
        </tr>
      </table>
      
      <c:if test="${not empty abonosGenerados}">      
          <table>
          <tr>
          <td><input name="Submit2" type="button" class="boton" value="Imprimir" onclick="javascript:reporteGenerado();"></td>
          </tr>
          </table>
      </c:if>

    </td>
  </tr>
</table>
</form:form> 
